
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    Navigator,
    StatusBar,
    View
} from 'react-native';


import Basic from './pages/Basic'

export default class App extends Component {
    render() {
        return (
            <View style={styles.container}>
                <StatusBar
                    animated={true}
                    backgroundColor="#00bfff"

                />
                <Navigator
                    initialRoute={{params:{name:'首页'},component:Basic}}
                    // 配置手势动画
                    configureScene={(route) => {
                        if (route.sceneConfig) {
                            // 去除手势的代码
                            //let res=route.sceneConfig;
                            //res.gestures=null;
                            //return res;
                            return route.sceneConfig;
                        }
                        return Navigator.SceneConfigs.FloatFromBottom;
                    }}

                    // 渲染初始的页面
                    renderScene={(route, navigator) =>{
                        let DefaultComponent=route.component;
                        return <DefaultComponent {...route.params} navigator={navigator}/>
                    }
                  }
                />
            </View>

        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1
    }
});

